﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DataServer.DAO;
using DataServer.DTO;

namespace DataServer.Models
{
    public class PhongBanCTL
    {
        private PhongBanDTO info = new PhongBanDTO();
        private PhongBanDAO data = new PhongBanDAO();

        public PhongBanDTO PhongBan
        {
            get
            {
                return info;
            }
            set
            {
                info = value;
            }
        }

        public bool insert()
        {
            return data.ThemPhongBan(info);
        }

        public bool delete()
        {
            return data.XoaPhongBan(info.MAPHG);
        }

        public bool update(string id)
        {
            return data.SuaPhongBan(id, info);
        }

        public List<PhongBanDTO> getDsPhongBan()
        {
            return data.LayDanhSachPhongBan();
        }

        public PhongBanDTO getPhongBan(string id)
        {
            return data.getPhongBan(id);
        }

        public List<string> GetColName()
        {
            return data.GetColName();
        }

    }
}